public class Lab1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        while (true) {
            System.out.print("Please input two integers:");
            try {
                int num1 = input.nextInt();
                int num2 = input.nextInt();
                System.out.printf("%d + %d = %d", num1, num2, num1 + num2);
                break;
            } catch (Exception e) {
                System.out.println("Try again.(Incorrect input: an integer is required)");
                e.printStackTrace();
                input.nextLine();
            }
        }
    }
}